<#-- 导入变量定义文件 -->
<#include "../template/include/assign.ftl">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>充值方式操作</title>
<#-- 导入静态资源文件 -->
<#include "../template/include/source.ftl">
<link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.page{
		float:right;
		padding-top: 15px;
		margin-right: 15px;
	}   
</style>
</head>
<#include "../template/template_listPage.ftl">
<body class="list">
	<script type="text/javascript">
	$().ready( function() {
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
		$(".areaCss").mouseout(function(e){						   
			$("#areaEach").hide();
		});
	});
	
	function deleter(id){
	 var result = confirm("你确认要删除吗?");
	 if (result) {
		var url="${web_base}/recharge/supplier_recharge_mode!delete.htm?id="+id;
		document.forms[0].action=url;
		document.forms[0].submit();
	}
    }

	function showArea(id){
	jQuery.ajax({
		url:"${web_base}/recharge/supplier_recharge_mode!findAreaList.htm",
		data:"id="+id,
		type:"post",
		dataType:"json",
	    success:function(data){
			if (!data || !data.areaAble){
			      return;
			}
		    if(data.areaAble.length>0){
				var  area="";
				for(i=0;i<data.areaAble.length;i++){   
			      area+=data.areaAble[i].areaName;
				}
				$("#areaEach").html(area);
				$("#areaEach").show();
		    }		
        }
	});
    }
	</script>
	<div class="body">
		<div class="listBar">
			<h1><span class="icon">&nbsp;</span>充值方式列表&nbsp;<input type="button" class="addButton" onclick="location.href='${web_base}/recharge/supplier_recharge_mode!add.htm'" value="添加充值方式" /></h1>
		</div>
		<div id="areaEach" style="width:300px;display:none;position:absolute;background:#FFF;border:2px solid #373737;" class="pop_box"> 
           
        </div>
		<@pageList page=(page!) id="listForm" query="supplierRechargeModeQuery" isEmpty=true >
		<div class="operateBar">
			<label>名称:</label>
			<label class="searchText"><input type="text" name="supplierRechargeModeQuery.name" value="${(supplierRechargeModeQuery.name)!}" /></label><input type="submit" id="searchButton" class="searchButton" value="" />
		</div>		
		<table class="listTable">
			<tr>
				<th>
					<span class="sort">名称</span>
				</th>
				<th>
					<span class="sort">运营商</span>
				</th>
				<th>
					<span class="sort">号码类型</span>
				</th>
				<th>
					<span class="sort">接口账户名称</span>
				</th>
				<th>
					<span class="sort">可充值区域</span>
				</th>
				<th>
					<span class="sort">最小面额</span>
				</th>
				<th>
					<span class="sort">最大限额</span>
				</th>
				<th>
					<span class="sort">相关业务</span>
				</th>
				<th>
					<span class="sort">可充值时间</span>
				</th>	
				<th>
					<span class="sort">是否启用</span>
				</th>			
				<th>
					操作
				</th>								
			</tr>
		<#if  page??&&page.list??&&(page.list?size gt 0) >
		<#list page.list as entry>
			<tr>
				<td>
					${(entry.name)!}
				</td>
				<td>
					${operationMethod((entry.operationCode)!)!}
				</td>
				<td>
					${phoneTypeMethod((entry.phoneType)!)!}
				</td>
				<td>
					${(entry.accountName)!}
				</td>
				<td>
				    <#if entry??&&entry.areaList??>
				    <span class="areaCss" onclick="showArea('${(entry.id)!}');">
					<#list entry.areaList as row>
						<#if row_index<=5>${(row.areaName)!}</#if>
					</#list>
					<#if 6<=entry.areaList.size()>...</#if>
					</span>
					</#if>					
				</td>
				<td>
				${money((entry.minAmount)!)!}
				</td>
				<td>
				${money((entry.maxAmount)!)!}
				</td>
				<td>
					<#if entry.enableQuery?string('true','false')=="true" >允许查询</#if>
					<#if entry.enableRecharge?string('true','false')=="true" >允许充值</#if> 
					<#if entry.enableReverse?string('true','false')=="true" >允许冲正</#if>
					<#if entry.enableAdjustment?string('true','false')=="true" >允许调账</#if> 
					<#if entry.enablePointRecharge?string('true','false')=="true" >允许带小数位缴费</#if>					
				</td>
				<td>
					<#if entry.startTime?exists&&entry.startTime?is_date>${entry.startTime?string("HH:mm:ss")}</#if>
					-<#if entry.endTime?exists&&entry.endTime?is_date>${entry.endTime?string("HH:mm:ss")}</#if>
				</td>
				<td>
				   ${entry.enable?string('是','否')}
				</td>
				<td>
					<a href="${web_base}/recharge/supplier_denomination!list.htm?modeId=${(entry.id)!}" title="充值面额">[充值面额]</a>
				    <a href="${web_base}/recharge/supplier_recharge_mode_log!list.htm?id=${(entry.id)!}" title="历史记录">[历史记录]</a>
					<a href="${web_base}/recharge/supplier_recharge_mode!edit.htm?id=${(entry.id)!}" title="编辑">[编辑]</a>
					<a href="javascript:void(0);" onclick="deleter('${(entry.id)!}');" title="删除">[删除]</a>
				</td>				
			</tr>
		</#list>
		<#else>
		    <tr><td colspan="11">
			<div class="noRecord">
				没有找到任何记录!
			</div>	
			</td></tr>
		</#if>
		</table>
		</@pageList>
	</div>
</body>
